package com.wangan.wanganpush.dao;

import com.wangan.wanganpush.model.UserReg;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface UserRegDao extends JpaRepository<UserReg,Integer> {

    //根据flag字段查询出未发送的数据
    @Query(value = "SELECT * from wangan_user_reg a where a.flag = ?1 limit 0,1000;", nativeQuery = true)
    List<UserReg> findAllByFlag(int flag);
}
